UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rEAFVkw69clkPhZjhOq2ILQeGWJWC47L330Rl8UT1UE='
WHERE
key_id = '144fc1e4b113b6c798af83e28fbe8bd38ddec5e9ba85e65264147ec0eac5b051'
AND (
token = 'rEAFVkw69clkPhZjhOq2ILQeGWJWC47L330Rl8UT1UE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)