UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0SNL2sLGRXeD+uX/2JUPq9xDxIK7mnl/gw5U+KAK6hg='
WHERE
key_id = '68638e53e5cfc55510f993fcff4ad776976b6a7dddac857b2174f6c4f23eba7c'
AND (
token = '0SNL2sLGRXeD+uX/2JUPq9xDxIK7mnl/gw5U+KAK6hg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)