UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/z4Z0fpsyzWpj9Cf4VE8uC6nn+I7znZYoft3n9HkOCo=' 
WHERE 
  key_id = '0b5bbf86872943d3abeb29320b609d114ab39c56e4b4da6a3882ef537efc5d59' 
  AND (
    token = '/z4Z0fpsyzWpj9Cf4VE8uC6nn+I7znZYoft3n9HkOCo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028