UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w26H+poXKxDY4hDPN5PsCJHXICHqpGoznzQHoY9eh6E=' 
WHERE 
  key_id = '78911d4bbad571639256951e0e7cdaa87319ba2ceb1cbfd53f7d6324543d5ddc' 
  AND (
    token = 'w26H+poXKxDY4hDPN5PsCJHXICHqpGoznzQHoY9eh6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028