UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5XeIfnv/RAw1ndHM2+NtuKZPdG7gTRSllE0+u3Oou20=' 
WHERE 
  key_id = '202c952ea2b56e5d18f9d9006e25261f5cea09fd7bde6ca517b8cb5761404d94' 
  AND (
    token = '5XeIfnv/RAw1ndHM2+NtuKZPdG7gTRSllE0+u3Oou20=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034