UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RHr8mf0sYLHr5WQJaZAFj9EIuAzfh5bwCzoHERzPGJw='
WHERE
key_id = '26b307c7c5cb492b0ec3eb413b1d5bdb347e5db5dd51bdba2af594ef29e7f23a'
AND (
token = 'RHr8mf0sYLHr5WQJaZAFj9EIuAzfh5bwCzoHERzPGJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)