UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NmQc6F8ljA3XWgQaQK/fHHKOz33la9Ad0+Vj5B4E9aA='
WHERE
key_id = '57e8a6aba588a1c6d108288451cd82d921bd2557a62c1ad3d1c468d147abf54a'
AND (
token = 'NmQc6F8ljA3XWgQaQK/fHHKOz33la9Ad0+Vj5B4E9aA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)