UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Mc5ugAZNPuhp28v9k04eV8VQXiICdQiWkxUJVGNdsM='
WHERE
key_id = 'd590cf461fa2ee4c1addd704efefdc6faaf7799933b6b6a738cd673c19d7f0a9'
AND (
token = '7Mc5ugAZNPuhp28v9k04eV8VQXiICdQiWkxUJVGNdsM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)