UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ginr3HPQwhlnqgxfYmh3QWSULMMisvrqqJvMlpC5c+U='
WHERE
key_id = '140c6ba1b88e4409bfb87ce5829e43b9b7383db6fbdab81f5dc70177cbf3ba36'
AND (
token = 'Ginr3HPQwhlnqgxfYmh3QWSULMMisvrqqJvMlpC5c+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)