UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ShVdoQ49FR0/cmZ0/kTWw+X0uCZFWg7J10u9aeoFgHU=' 
WHERE 
  key_id = 'cb74e7a88c56a1c7898cfc62e1b39b51f98143a15daa7bcbd4c07ee0b9565b24' 
  AND (
    token = 'ShVdoQ49FR0/cmZ0/kTWw+X0uCZFWg7J10u9aeoFgHU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032