UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zg9MezyJi9RhcFkTnyY0HCoKGnnPhTLvNg/mdbKEIgU='
WHERE
key_id = '5334220480448cc2fc2ebfd293e0b19c199f48706dd11d5ab3c6e6b83ed3a923'
AND (
token = 'Zg9MezyJi9RhcFkTnyY0HCoKGnnPhTLvNg/mdbKEIgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)