UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KK/vtylUbyo1EOg1tG/xo4w46qXjHAqrj0VW1xZoQLc='
WHERE
key_id = '9ec1894de00fc5c909979c21bcb21f36405c7c901c5baf9ab5af5fec2839a260'
AND (
token = 'KK/vtylUbyo1EOg1tG/xo4w46qXjHAqrj0VW1xZoQLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)