UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0904GAV1vhCuwNkEgsV37Q6lpp9j3Q5qVwmqxikv2cY='
WHERE
key_id = '6badaf42f17c2aca353dd7458ae6f17fc8662868dadb69033cfa35c95e8b45d6'
AND (
token = '0904GAV1vhCuwNkEgsV37Q6lpp9j3Q5qVwmqxikv2cY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)