UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SI4AVbEBmAM1xlpK7cV7XpIN1ukSl/CfmwRBCW5YupQ=' 
WHERE 
  key_id = 'cf9615eafb859adf5a4a3a877d7e7e2b026885b595b00c4e40e51b1be314b7a6' 
  AND (
    token = 'SI4AVbEBmAM1xlpK7cV7XpIN1ukSl/CfmwRBCW5YupQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054