UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pa4OBh3SHh9qPidKtKMl1Pe0Fs1nkaWTrziKgVOq6oY=' 
WHERE 
  key_id = '97e2f7d919ec6f7b1763493f5d79c1903bce31661aea5e34728717a16e59dbc5' 
  AND (
    token = 'Pa4OBh3SHh9qPidKtKMl1Pe0Fs1nkaWTrziKgVOq6oY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030