UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QmJFuZZaLdfeLWkw9EKKueYGADGEdOE/O6IrTXYG9Q4='
WHERE
key_id = 'ea946e9b69fd8f08b3ed7f077640772bd25078faf3dc69c94cd7c4d77dbd122a'
AND (
token = 'QmJFuZZaLdfeLWkw9EKKueYGADGEdOE/O6IrTXYG9Q4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)