UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1P373TdzMd+d9fccxWJA/Gah1i98iS7/WatGUycQSWA=' 
WHERE 
  key_id = '17f85c4e69dbbb8abbd448ae8fa92b22ddc94696d27db6c35bf6d3ea76950f7a' 
  AND (
    token = '1P373TdzMd+d9fccxWJA/Gah1i98iS7/WatGUycQSWA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029