UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fZhquKagcZCmVTR2lHIpCHIEtB083RXU0/e1ZY4GONM=' 
WHERE 
  key_id = '8c3150a048192b7dcf30980addd94d181059d70e18a1ab75f261f0127b9e64ed' 
  AND (
    token = 'fZhquKagcZCmVTR2lHIpCHIEtB083RXU0/e1ZY4GONM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053