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