UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aY6Gmt7sh7BGeAn8Vu7IQ46aq4t0pfGfutlDKeBTgBc=' 
WHERE 
  key_id = '6d83c902523c6fac0b65235d0de44c06699fcb927de000fcc3eabde16fd6adfb' 
  AND (
    token = 'aY6Gmt7sh7BGeAn8Vu7IQ46aq4t0pfGfutlDKeBTgBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030