UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fwkFx+G9ILlDR+jthWxEXwf9ycxbXn4RrEl+VmQ1NmQ='
WHERE
key_id = 'f51c79d79258357809f6e64279276f101a80a0cdfa41cef66a1c6ddb3545b711'
AND (
token = 'fwkFx+G9ILlDR+jthWxEXwf9ycxbXn4RrEl+VmQ1NmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)