UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b0fJKlikq9MfyDqMmFUBeyRtn9RyFakHAOT6zEzuFdQ='
WHERE
key_id = '5d3c35d9980c588ae66d7aa3fa501de6d2926ba8decc50c3e31aa244b48c576f'
AND (
token = 'b0fJKlikq9MfyDqMmFUBeyRtn9RyFakHAOT6zEzuFdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)