UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u/DWcnnwTdYq992zfB50SyKaID+eWyK5QR5oyLMeO8w=' 
WHERE 
  key_id = '923c8acace9282661001944a7c3cc9ce754dda7583de2aa85d08163fb01e8a2a' 
  AND (
    token = 'u/DWcnnwTdYq992zfB50SyKaID+eWyK5QR5oyLMeO8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032