UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hboHjURf2BPFbpZ0fYJSak6Qb3uuUPgjJo1X/U4xnCY='
WHERE
key_id = 'e456e758130932e565dba7c6d274fd63c9211b303eeadf01ddb4009a72f1cb3a'
AND (
token = 'hboHjURf2BPFbpZ0fYJSak6Qb3uuUPgjJo1X/U4xnCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)