UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AoGN/J82p6CHMGyFlWys4DY4qkmM+RuOC/m2R0Z+cb0='
WHERE
key_id = '602f0bdd4f81b0dd3acd4e2cbeb0799d6247650dbb2854721194c3dd21b0ba3b'
AND (
token = 'AoGN/J82p6CHMGyFlWys4DY4qkmM+RuOC/m2R0Z+cb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)