UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gw/8nLubLSlWr4U33/16vshEXV5U+oMXJigy0wxkhEU='
WHERE
key_id = '1e4aebd95f4d2b4d7eced2c0e9185d4da2600c597bef6706a031eb283dc3860e'
AND (
token = 'gw/8nLubLSlWr4U33/16vshEXV5U+oMXJigy0wxkhEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)