UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YYXi/Cn173rqaekTcb0shJfP3XZAEpgmnQqiSNhN0tw='
WHERE
key_id = '5d0d89cbfe2b9ba633e6305e40212d52ad2ea7572a68cb0d80b43c5240fb72fa'
AND (
token = 'YYXi/Cn173rqaekTcb0shJfP3XZAEpgmnQqiSNhN0tw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)