UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4t+O+U0JxUAziXxyHwjHkyp96uJToW21hHFtyROE1ig=' 
WHERE 
  key_id = '2959b762963acc2d2b7cae813f755fafb6d821ff013e348b4d7452a98ffbf102' 
  AND (
    token = '4t+O+U0JxUAziXxyHwjHkyp96uJToW21hHFtyROE1ig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035