UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R96r5h18pIQTkRLGrYFLWxYSFbop+/8/QhQ+DqgU2R4='
WHERE
key_id = 'ec7003eec2c92973d6066e99930a6e942cee3e2623508fb41dd5d9ebce7b82e3'
AND (
token = 'R96r5h18pIQTkRLGrYFLWxYSFbop+/8/QhQ+DqgU2R4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)