UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RGoNtTV4KnylB5souCU6tqCazlaFNtKiQAU0wkZgPgE='
WHERE
key_id = '8323b1a2e5ec30376c5068b256a686f985b7c5924b67eb7ef39f07ce6616fca9'
AND (
token = 'RGoNtTV4KnylB5souCU6tqCazlaFNtKiQAU0wkZgPgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)