UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cv9n4RgmSkx/bXO6kXqJncAt0xTB3dYY/katKkBFk3o=' 
WHERE 
  key_id = '5e89d67ea876892a37293f023bc48fffb0b8fef5647b18d4de8a7bb18d7423e6' 
  AND (
    token = 'Cv9n4RgmSkx/bXO6kXqJncAt0xTB3dYY/katKkBFk3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042