UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bcln1FlOcUYreZ14GFIwZ1A13Glx1VOv/Pbuz9O11/M=' 
WHERE 
  key_id = '0d0085daf09f426abe2cd2f784732e55f2315725575e2471e0255a2e1433769e' 
  AND (
    token = 'Bcln1FlOcUYreZ14GFIwZ1A13Glx1VOv/Pbuz9O11/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032