UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k40i7r2R7R7maKvlOlrLivKFmtqLLtMAfhpW1tE3ieA=' 
WHERE 
  key_id = '73c8a10f6a8d28210b87b7090e97e172ae1f9c852ac1754c4b0c3a405d6ef8b2' 
  AND (
    token = 'k40i7r2R7R7maKvlOlrLivKFmtqLLtMAfhpW1tE3ieA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047