UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ROvvo7WfUvjGA8VtKnYzwDvmuvUWBAEZAnnVpPecmNc='
WHERE
key_id = '49d334c93df46751a81b026bed752e7f16412e7d80923f19f1f28444f7d20ad3'
AND (
token = 'ROvvo7WfUvjGA8VtKnYzwDvmuvUWBAEZAnnVpPecmNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)