UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'emhsqpvAmubTTRW+KiMiYNaigbR7BZRpFZOmUr1LwwY='
WHERE
key_id = '165864aaec0a43021991574335618f6b270b12c1ba497e247feed3aa6d5925dc'
AND (
token = 'emhsqpvAmubTTRW+KiMiYNaigbR7BZRpFZOmUr1LwwY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)