UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'soNdd98La197Xm2ClTUidfkdrYjab5tYRNMFOdF+kmo=' 
WHERE 
  key_id = '0186cf3cbb4cc9156b2575af68c6955dcb4b534328c795b0d4645eee8d6dffff' 
  AND (
    token = 'soNdd98La197Xm2ClTUidfkdrYjab5tYRNMFOdF+kmo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068