UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd+Hi72/pOVcVk7a3C0U4aSAfI1jZSrLHUKtFioIc+rQ=' 
WHERE 
  key_id = '8c13d542540d42613cbd3e51f9eb16369f4e95dbaf86c6515398c8b7d510b21d' 
  AND (
    token = 'd+Hi72/pOVcVk7a3C0U4aSAfI1jZSrLHUKtFioIc+rQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027