UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WL3OLX6AH91dXBdKsWjG/HzXgMI8/smKJBOUeX455Q4='
WHERE
key_id = '611e6641ca74f07ccac442d16eb651bc11b629d04fb56ec94913601e4ab216df'
AND (
token = 'WL3OLX6AH91dXBdKsWjG/HzXgMI8/smKJBOUeX455Q4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)