UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hoxa5DvHgvAS5ra5iz8v5syqu+PEKET+OG3s70b7d38=' 
WHERE 
  key_id = '9c0f1071f1ad86ab6049af4efb537cb88b9aef055da9cd6b1d4a2cca0fa166a5' 
  AND (
    token = 'Hoxa5DvHgvAS5ra5iz8v5syqu+PEKET+OG3s70b7d38=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019