UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v52y0SWMaRFSYBKZ7HvTKN3OxsgIF7eA00GCJnUl1EY='
WHERE
key_id = '11828da1f8176bd27342bd82912bc6ff7ff9db79d66b7acc329303bca46fa6d2'
AND (
token = 'v52y0SWMaRFSYBKZ7HvTKN3OxsgIF7eA00GCJnUl1EY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)