UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fd1om7TmMHd347aX+VFV1RtJU5URQwnxKV8aQHyp0lA='
WHERE
key_id = '28741209cc82a1b03c6bc37f743d49abd9039cf5dc7e9820f8e27b5f44becebe'
AND (
token = 'fd1om7TmMHd347aX+VFV1RtJU5URQwnxKV8aQHyp0lA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)