UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4AmjmFIDQGnlvOWXi9Eo/raofEEkynoo8+Xy/xBRAwU='
WHERE
key_id = 'c0d2deeb9f3e7fba74642ed6bf379ad1c51eecd0f353e382127140eac768103c'
AND (
token = '4AmjmFIDQGnlvOWXi9Eo/raofEEkynoo8+Xy/xBRAwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)