UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VwhKT/aUXpFzoRRPR/LWCNw4RXTqF8hhdKPKVhJYHMM='
WHERE
key_id = '0e264dc6c9473707d2188a41ccce23879a82f809b70931e0d6f05d4474c5ee4e'
AND (
token = 'VwhKT/aUXpFzoRRPR/LWCNw4RXTqF8hhdKPKVhJYHMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)