UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fCozlxQBXw8foR4JZh1lGk3Xfmy+lya4PF0jmDw7efM='
WHERE
key_id = 'a836bab4a3464d68d71da40ba0130a9ce997299c37fa98fb0a378a93384c3fcc'
AND (
token = 'fCozlxQBXw8foR4JZh1lGk3Xfmy+lya4PF0jmDw7efM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)